package com.mz.ozy.mvp.presenter;


import android.app.Activity;

import com.mz.ozy.base.BasePresenterImpl;
import com.mz.ozy.bean.JDDetailBean;
import com.mz.ozy.mvp.model.JDDetailModel;
import com.mz.ozy.mvp.view.JDDetailContract;
import com.mz.ozy.net.MyObserver;
import com.mz.ozy.utils.RxUtil;

import okhttp3.ResponseBody;

/**
 * Created by administrator on 2018/12/3.
 */
public class JDDetailPresenter extends BasePresenterImpl<JDDetailContract.View> implements JDDetailContract.Presenter{

    private JDDetailModel mModel;

    public JDDetailPresenter(){
        mModel = new JDDetailModel();
    }


    @Override
    public void getJDDetail(Activity activity, String pageNo) {
        mModel.getJDDetail(activity,pageNo)
                .compose(RxUtil.rxSchedulerHelper(mView.<ResponseBody>bindToLifecycle()))
                .subscribe(new MyObserver<JDDetailBean>(mView,false){
                    @Override
                    public void onSuccesss(JDDetailBean bean) {
                        mView.getJDDetailSuccess(bean);
                    }
                });
    }
}
